# i = 0
# sum = 0
# while i <= 100:
#     sum += i
#     i += 1
# print(sum)

# import random
# num = random.randint(1, 100)
# guess = int(input("Guess a number between 1 and 100: "))
# guess_times = 1
# while num != guess:
#     if num < guess:
#         guess = int(input("Guess higher, Guess a number between 1 and 100 again: "))
#         guess_times += 1
#     elif num > guess:
#         guess = int(input("Guess lower, Guess a number between 1 and 100 again: "))
#         guess_times += 1
# print(f"congradulations! you guessed {guess_times} times! ")

# while嵌套的使用
# i = 1
# while i <= 100:
#     print(f"今天是表白的第{i}天，准备表白。。。")
#     j = 1
#     while j <= 10:
#         print(f"这是我送的第{j}朵玫瑰花！")
#         j += 1;
#     print("小美，我宣你！")
#     i += 1
#
# print(f"坚持到第{i-1}天，表白成功！")

# 打印99乘法表
# i = 1
# while i <= 9:
#     j = 1
#     while j <= i:
#         print(f"{j}*{i}={i * j}", end=" ")
#         j += 1
#     print("")
#     i += 1

# for loop
# name = [1234,12344]
# for x in name:
#     print(x)

# 通过for循环，遍历此字符串，统计有多少个英文字母：'a'
# name = 'itheima is a brand of itcast'
# sum = 0
# for x in name :
#     if x == 'a':
#        sum += 1
#
# print(f"一共有{sum}个字母'a'", sum)

# for range语句
# range(5)  # 0,1,2,3,4
# range(1, 5)  # 1,2,3,4
# range(num1, num2, step)
# num3 = range(1, 10, 2)   # 1,3,5,7,9
# print(num3,type(num3))  # range(1, 10, 2) <class 'range'>
# for x in num3:
#     print(x)
# for y in range(10):
#     print("我要送玫瑰花！")
#
# num = 100
# count = 0
# x = 0
# for x in range(1, num):
#     if x % 2 == 0:
#         print(x)
#         count += 1
# print(f"有{count}个偶数")
# print(x)

# 坚持表白100天，每天送10朵玫瑰花
# x = 1
# for x in range(1, 101):
#     print(f"今天是表白的第{x}天！")
#     for y in range(1, 11):
#         print(f"这是我今天送的第{y}朵玫瑰花！")
#     print("小美，我宣你！")
#
# print(f"坚持到第{x}天，表白成功！")

# for loop print 9x9
# for x in range(1, 10):
#     for y in range(1,x+1):
#         print(f"{y}*{x}={y*x}", end=" ")
#     print()

# break和continue


# 某公司，账户有1W元，给20名员工发工资
# 员工编号从1到20 从编号1开始，依次领取工资，每人可领取1000元
# 领工资时，财务判断员工的绩效分（1-10）（随机生成），如果低于5分，不发工资，换下一位
# 如果工资发完了，结束发工资。
import random
total_money = 10000
for x in range(1,21):
    jixiao = random.randint(1,10)
    if jixiao < 5:
        print(f"员工{x}, 绩效分{jixiao}, 低于5，不发工资，下一位")
        continue
    if total_money >= 1000:
        total_money -= 1000
        print(f"向员工{x}发放工资1000元，账户余额还剩{total_money}元")
    else:
        print(f"余额不足，当前余额:{total_money}工资发完了，下个月领取吧。")
        break


